<?php printHeader('notes', false, 'notes', false); ?>

        <div id="list" class="block-middle">
            <div class="head-block">list</div>
            <table style="width:100%; text-align:center;">
                <tr>
                    <td><strong>ID</strong></td>
                    <td><strong>Nom</strong></td>
                    <td><strong>website</strong></td>
                    <td><strong>✏</strong></td>
                    <td><strong>✖</strong></td>
                </tr>
                <?php foreach($champs as $item){ ?>
                    <tr>
                        <td>(<?php echo htmlspecialchars($item["ID"]); ?>)</td>
                        <?php if($item["infos"] == "") { ?>
                        <td><?php echo htmlspecialchars(utf8_encode($item["name"])); ?></td>
                        <?php } else { ?>
                        <td><a href="#" class="legende"><?php echo htmlspecialchars(utf8_encode($item["name"])); ?><span><?php echo utf8_encode($item["infos"]); ?></span></a></td>
                        <?php } ?>
                        <td><a href="<?php echo htmlspecialchars($item["website"]); ?>" class="a-img"><img src="images/link.png" alt="[www]" /></a></td>
                        <td><a href="notes.php?admin=edit&amp;id=<?php echo $item["ID"]; ?>" class="a-img"><img src="images/pencil.png" alt="[ ✏ éditer ]" /></a></td>
                        <td><a href="notes.php?admin=delete&amp;id=<?php echo $item["ID"]; ?>" class="a-img"><img src="images/cross.png" alt="[ ✖ supprimer ]" /></a></td>
                    </tr>
            <?php    } ?>
            </table>
            
        </div>
        <div id="add" class="block-middle">
            <div class="head-block">add</div>
            <form action="notes.php?go=add" method="post" enctype="multipart/form-data">
                    <fieldset style="text-align:left; width:95%; margin:auto;">
                        <legend>Ajouter une note</legend>
                        <table style="margin:auto;">
                            <tr>
                                <td><label id="titreLabel" for="titre">Titre :</label></td>
                                <td><input type="text" name="titre" id="titre" size="74" onblur="verifRegex(this, rgxTitre)"/></td>
                            </tr>
                            <tr>
                                <td colspan="2" style="text-align:center;"><textarea id="texte" name="texte" cols="180" rows="5" onfocus="clearTextArea(this, defautNews)"></textarea></td>
                            </tr>
                            <tr>
                                <td><label id="lienLabel" for="lien">Lien :</label></td>
                                <td><input type="text" name="lien" id="lien" size="94" /></td>
                            </tr>
                            <tr>
                                <td><label id="publicLabel" for="public">Public :</label></td>
                                <td><input type="checkbox" name="public" id="public" checked="checked" /></td>
                            </tr>
                            <tr>
                                <td colspan="2" style="text-align:center;">
                                    <br /><input type="reset" value="Réinitialiser" />
                                    <input type="submit" value="Envoyer!" /><br />
                                    <span id="footerErreurTitre" style="display:none; color:red;" ><br />/!\ Erreur dans le titre /!\</span>
                                    <span id="footerErreurDate" style="display:none; color:red;" ><br />/!\ Erreur dans la date (nombre) /!\</span>
                                </td>
                            </tr>
                            
                        </table>
                        <script type="text/javascript">
    var editor = CKEDITOR.replace( 'texte',
    {
        toolbar : 'News',
        contentsCss : 'ckeditor/contents.css',
        coreStyles_underline	: { element : 'span', attributes : {'class': 'Underline'}},
        coreStyles_strike	: { element : 'span', attributes : {'class': 'StrikeThrough'}, overrides : 'strike' },
        coreStyles_subscript : { element : 'span', attributes : {'class': 'Subscript'}, overrides : 'sub' },
        coreStyles_superscript : { element : 'span', attributes : {'class': 'Superscript'}, overrides : 'sup' },
    });
                        </script>
                    </fieldset>
                </form>
        </div><br />
<?php

printFooter();